package com.nexen.merchant.barcode.domain;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.nexen.common.annotation.Excel;
import com.nexen.common.core.domain.BaseEntity;
import org.apache.poi.ss.usermodel.IndexedColors;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 条形码对象 nexen_Barcode
 * 
 * @author xiao
 * @date 2024-07-31
 */
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY,getterVisibility = JsonAutoDetect.Visibility.NONE)
@Data
@NoArgsConstructor
@AllArgsConstructor
public class NexenBarcode extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** Id */
    private Long Id;

    @Excel(name = "出库日", type = Excel.Type.ALL, prompt = "出库日")
    private String deliveryDate;

    /** 产品代码 */
    @Excel(name = "成品代号")
    private String productCode;

    /** 产品名称 */
    @Excel(name = "SIZE名")
    private String productName;

    /** 规格型号 */
    @Excel(name = "出库数量")
    private String deliveryQuantity;

    /** 条形码 */
    @Excel(name = "条形码", type = Excel.Type.ALL, headerBackgroundColor = IndexedColors.RED,  cellType = Excel.ColumnType.STRING, prompt = "条形码")
    @Size(message = "条形码长度必须是10位", min = 10, max = 10)
    @NotNull(message = "条形码不能为空")
    private String code;

    /** 规格型号 */
    @Excel(name = "生产日期")
    private String productionDate;

    /** 目的地 */
    @Excel(name = "目的地")
    private String destination;

    /** 状态 */
//    @Excel(name = "状态: 可选值(未使用 / 已使用 / 已过期 / 审核中)", width=45, headerBackgroundColor = IndexedColors.RED, readConverterExp = "1=未使用,2=已使用,3=已过期,4=审核中")
//    @NotNull(message = "状态格式不正确")
    private Integer status;

    /** 参加互动 */
//    @Excel(name = "参加活动: 可选值(不参加 / 参加)",  width=35, headerBackgroundColor = IndexedColors.RED,  readConverterExp = "0=不参加,1=参加")
//    @NotNull(message = "参加活动格式不正确")
    private Integer activity;

    /** 相关联的质保卡 */
    //@Excel(name = "相关联的质保卡")
    private Long warrantyCardId;


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("Id", getId())
            .append("deliveryDate", getDeliveryDate())
            .append("productCode", getProductCode())
            .append("productName", getProductName())
            .append("productionDate", getProductionDate())
            .append("deliveryQuantity", getDeliveryQuantity())
            .append("code", getCode())
            .append("destination", getDestination())
            .append("status", getStatus())
            .append("activity", getActivity())
            .append("warrantyCardId", getWarrantyCardId())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }
}
